 <?php

if(empty($cat)){$cat = 'select theme';}
if(empty($right_side)){$right_side = '';}
if(empty($left_side)){$left_side = '';}
if(empty($themes_list)){$themes_list = '';}
if(empty($content)){$content = '';}

$right_side = $right_side . quick_info('Quick Summary','
users count: '.get_users_count().'
<br>subtitles count: '.get_subtitles_count().'
<br>videos count: '.get_videos_count().'
');

$right_side = $right_side . "<br>" . quick_links('Quick Links','
<a href="http://sourceforge.net/projects/onlinesubtitles/forums/forum/1758498" target="_blank">Open Discussion</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><a href="http://sourceforge.net/tracker/?group_id=534975&atid=2172715" target="_blank">Bugs</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><a href="http://sourceforge.net/projects/onlinesubtitles/forums/forum/1758499" target="_blank">Help Forum</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><a href="http://sourceforge.net/tracker/?group_id=534975&atid=2172718" target="_blank">Feature Requests</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><a href="http://sourceforge.net/projects/onlinesubtitles/forums/forum/1761558" target="_blank">Security Forum</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><a href="http://sourceforge.net/tracker/?group_id=534975&atid=2172716" target="_blank">Support Requests</a>
');

$home_list[0][0] = 'select theme';
$home_list[0][1] = 'index.php?page=themes&cat=select theme';
$left_side = $left_side . left_list('theme options',$home_list);

$selected_dir = read_option('theme_folder');

$all_themes = scandir('../templates');
for ($i = 0; $i <= count($all_themes)-1; $i++) {
if($all_themes[$i]!='.' and $all_themes[$i]!='..')
{
	if($selected_dir==$all_themes[$i]){$selected="selected='selected'";}else{$selected="";}
    $themes_list = $themes_list . "<option value='".$all_themes[$i]."' ".$selected.">" . $all_themes[$i] . "</option>";
}
	}
//echo $themes_list;

$content = $content . content_tabs($cat, "
                <div class='table'>
				<form method='post' action='index.php'>
                    <table class='listing form' cellpadding='0' cellspacing='0'>
                        <tr>
                            <th class='full' colspan='2'>Themes</th>
                        </tr>
                        <tr>
                            <td><strong>select theme</strong></td>
                            <td><select name='selected_theme_folder'>".$themes_list."</select></td>
                        </tr>
                    </table>
					<input type='hidden' name='page' value='themes' />
					<input type='hidden' name='cat' value='select theme' />
					<input type='hidden' name='save_theme' value='yes' />
					<input type='submit' value='save' />
					</form>
                </div>
				
");

?>